
*	************************************************************************
* 	File-Name: 		RIO_2013_TechTransfer_replication.do
*	Date:  			9 August 2012
*	Authors: 		Patrick Bayer and Johannes Urpelainen
*	Journal:		Review of International Organizations
* 	Paper:			External Sources of Clean Technology: Evidence from the Clean Development Mechanism
*
*	Data Used:  	Tech.dta	
*	Purpose:   		.do file for replication
*	Software:		Stata IC 12.1
*	Machine:		WINDOWS 7
*
*	************************************************************************

clear all

* NB: Please place .do file and data in the same folder
use "./Tech.dta"
set more off, permanently


*	************************************************************************
*	(I) MAIN TEXT
*	************************************************************************

*	************************************************************************
*	1. Summary statistics
*	************************************************************************

* Full sample
quietly xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
estpost summarize DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt if e(sample)


* Sample without China
quietly xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
estpost summarize DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt if hostcountry != "China" & e(sample)


* Sample without India
quietly xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe
estpost summarize DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt if hostcountry != "India" & e(sample)


*	************************************************************************
*	2. Main models fixed effects
*	************************************************************************

eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3  if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

eststo: xtprobit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy lnL1pop L1internet L1industry_gdp L1InvestProfile L1fdi lnL1patents renew_patents IPP_2005 t t2 t3, re
eststo: xtprobit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy lnL1pop L1internet L1industry_gdp L1InvestProfile L1fdi lnL1patents renew_patents IPP_2005 t t2 t3  if hostcountry != "China", re
eststo: xtprobit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy lnL1pop L1internet L1industry_gdp L1InvestProfile L1fdi lnL1patents renew_patents IPP_2005 t t2 t3 if hostcountry != "India", re



*	************************************************************************
*	(II) APPENDIX
*	************************************************************************

*	************************************************************************
*	A4 -- Correlation Matrics (Table A3)
*	************************************************************************

* Full sample
quietly xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
estpost correlate DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt if e(sample), matrix


* Sample without China
quietly xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
estpost correlate DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt if hostcountry != "China" & e(sample), matrix


* Sample without India
quietly xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe
estpost correlate DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt if hostcountry != "India" & e(sample), matrix


*	************************************************************************
*	A6 -- Matching Exercise (Table A5)
*	************************************************************************

* See http://gking.harvard.edu/cem/ for implementation of CEM in Stata

drop if renew==.
imb small unilat L1corrupt, treatment(renew)
cem small unilat L1corrupt, treatment(renew) autocuts(sturges)

* NB: dataset is reduced to matched sample
keep if cem_matched==1

eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe


*	************************************************************************
*	A7 -- Robustness Checks (Table A6-A21)
*	************************************************************************

* Robustness: Main Models without Hydroelectricity Projects (Table A6)
* NB: Reload full dataset
clear all
use "Tech.dta"

eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hydro==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China" & hydro==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India" & hydro==0, fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hydro==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China" & hydro==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India" & hydro==0, fe

* Robustness: Main Models without Energy Efficiency Projects (Table A7)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if ee==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China" & ee==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India" & ee==0, fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if ee==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China" & ee==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India" & ee==0, fe

* Robustness: Exclusion of Canceled Projects (Table A8)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if cancel==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China" & cancel==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India" & cancel==0, fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if cancel==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China" & cancel==0, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India" & cancel==0, fe

* Robustness: Exclusion of Projects in South Korea (Table A9)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "Korea, Rep.", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China" & hostcountry != "Korea, Rep.", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India" & hostcountry != "Korea, Rep.", fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "Korea, Rep.", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China" & hostcountry != "Korea, Rep.", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India" & hostcountry != "Korea, Rep.", fe

* Robustness: Main Models with Current Number of Projects (Table A10)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncountrenew Ncountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncountrenew Ncountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncountrenew Ncountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Robustness: Interaction Models
* Interaction Model with Small Projects (Table A11)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small renewXsmall unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small renewXsmall unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small renewXsmall unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Interaction Model with Unilateral Projects (Table A12)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat renewXunilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat renewXunilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat renewXunilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Interaction Model with Corruption (Table A13)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt renewXcorrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt renewXcorrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt renewXcorrupt t t2 t3 if hostcountry != "India", fe

* Interaction Model with Democracy (Table A14)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy renewXdemo t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy renewXdemo t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy renewXdemo t t2 t3 if hostcountry != "India", fe

* Interaction Model with Population (Table A15)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1democracy L1corrupt lnL1pop renewXpop t t2 t3 , fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1democracy L1corrupt lnL1pop renewXpop t t2 t3 if hostcountry != "China", re
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1democracy L1corrupt lnL1pop renewXpop t t2 t3 if hostcountry != "India", re

* Robustness: Additional Interaction Effects
* Interaction Model with Renewable Patents (Table A16)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP renew_patents patXrenew t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP renew_patents patXrenew t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP renew_patents patXrenew t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP renew_patents patXrenew Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP renew_patents patXrenew Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP renew_patents patXrenew Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Interaction Model with Renewable Electricity Capacity (Table A17)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP lnL2renewcap capXrenew t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP lnL2renewcap capXrenew t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP lnL2renewcap capXrenew t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVtech renew lnL1gdp renewXGDP lnL2renewcap capXrenew Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP lnL2renewcap capXrenew Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP lnL2renewcap capXrenew Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Robustness: Alternative Measure for Absorptive Capacity (Table A18)
eststo clear
eststo: xtlogit DVtech renew lnL1patents renewXlnL1patents t t2 t3, fe
eststo: xtlogit DVtech renew lnL1patents renewXlnL1patents t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1patents renewXlnL1patents t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVtech renew lnL1patents renewXlnL1patents Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVtech renew lnL1patents renewXlnL1patents Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1patents renewXlnL1patents Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Further Analysis: Distinguishing Between Equipment and Knowledge Transfer
* Equipment Transfer (Table A19)
eststo clear
eststo: xtlogit DVequip renew lnL1gdp renewXGDP t t2 t3, fe
eststo: xtlogit DVequip renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVequip renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVequip renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVequip renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVequip renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Knowledge Transfer (Table A20)
eststo clear
eststo: xtlogit DVknow renew lnL1gdp renewXGDP t t2 t3, fe
eststo: xtlogit DVknow renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVknow renew lnL1gdp renewXGDP t t2 t3 if hostcountry != "India", fe

eststo: xtlogit DVknow renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3, fe
eststo: xtlogit DVknow renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVknow renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt t t2 t3 if hostcountry != "India", fe

* Robustness: Extended Model (Table A21)
eststo clear
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy lnL1pop L1internet L1industry_gdp L1InvestProfile L1fdi t t2 t3, fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy lnL1pop L1internet L1industry_gdp L1InvestProfile L1fdi t t2 t3 if hostcountry != "China", fe
eststo: xtlogit DVtech renew lnL1gdp renewXGDP Ncumcountrenew Ncumcountother small unilat L1corrupt L1democracy lnL1pop L1internet L1industry_gdp L1InvestProfile L1fdi t t2 t3 if hostcountry != "India", fe





